linux command line and shell scripting bible

Discover linux command line and shell scripting bible, include the articles, news, trends, analysis and practical advice about linux command line and shell scripting bible on alibabacloud.com

[Linux Command Line and Shell Scripting Bible] Basic Shell script

127Command not found the -Invalid exit Argument the -+x Fatal error with Linux signal x - theCommand terminated with ctl-C - 255Exit status outof Range the the+Exit Command the 1. can change this toreturnyour own exit status code. The Exit command the allows you to specify a exit status when your script ends: - (DO) theres=$[$a +$b] theExit5 theWhen checking exit code for the above program $?=5, you can

"Linux command line and Shell Scripting Encyclopedia" learning notes

First part: Linux command line"Linux command line and Shell Scripting Encyclopedia" chapter I: the first knowledge of Linux shell"

Linux command line and shell scripting---bash shell commands

contains the information and location of the source file. Referencing a hard-link file is equivalent to referencing a source fileCp-l test1 test4The-l parameter creates a hard-link test4 that points to the file test1.Note: You can only create hard links between files on the same storage media, and you cannot create hard links between files under different mount points.The parameter-s creates a symbolic link, or a soft connectionCp-s Test TEST5When copying a linked file, be aware that if you use

"Linux command line and Shell Scripting Encyclopedia" chapter Sixth environment variables

to customize their command aliases and private script functions3. non-interactive shellThis is the shell used by the system to execute shell scripts.There is no command line prompt.Bash shell provides bash_env environment variables. When a non-interactive shell is started,

"Linux command line and Shell Scripting Encyclopedia" chapter 17th Create a function

directly behind the. BASHRCfunction Addem{Echo $[$ [+ $]}This function is used anywhere on the system.2. Reading function filesYou can use the source command to add a function from the library file to the. BASHRCAdd it directly behind the. BASHRC. /home/xcy/myfuncsSo you can use the function inside the Myfuncs.17.8 exampleThis section describes the GNU Shtool Shell script function library. The Shtool library provides a few simple

"Linux command line and Shell Scripting Encyclopedia 3rd Edition"

The first part of the Linux command lineThe 1th chapter of the first knowledge of Linux she1.1 What is Linux 21.1.1 Deep Dive into Linux kernel 31.1.2 GNU Tools 61.1.3 Linux Desktop Environment 81.2 Linux Release 121.2.1 Core

"Linux command line and Shell scripting Encyclopedia" 23 chapters 24 chapters

echo "Top Ten Disk Space Usage" echo "for $CHECK _directories Directory" For Dir_check in $CHECK _directories Do echo "" echo "The $DIR _check Directory:" Du-s $DIR _check 2>/dev/null | Sort-rn | Sed ' {one, $D; =} ' | Sed ' N; s/\n//' | Gawk ' {printf $ ': "\ T" $ "t" $ "\ n"} ' Done Exit [Email protected]:~/shell/24zhang$ Run:./big_user.shOnly two directories/var/log/home are specified above, and the generated rep

The 15th chapter of the Linux command line and Shell Scripting Encyclopedia presents data

.2) read uses the IFS character to parse the text, and here we specify the IFS as a comma.Cat >> $outfile This includes an output append redirect (>>) and an input append redirect (>> appends the output of the cat command to the file specified by the $outfile variable.The input to the Cat command is not taken from standard input, but is redirected to the data stored in the script.The EOF symbol marks the beginning and end of the data appended to the file.Input file + run + Result:DescriptionSpe

"Linux command line and Shell Scripting Encyclopedia" chapter III study notes

specified shell command V Start the VI editor with the current file . Repeat the previous command N Find in file the overflow matches the content of the specified expression ‘ Jumps to the first content that the specified expression matches to Ctrl+l Redraw the current scre

The 12th chapter of the Linux command line and Shell scripting Encyclopedia uses structured commands

" Else echo "$val ^ 2 Fi Str1=xcyhaha if [[$str 1 = = xcy*]] Then echo "str1 = = xcy*, str1 is $str 1" Else echo "STR1! = xcy*, str1 is $str 1" Fi 12.7 Case CommandWith the case command, you don't have to write all the elif statements to keep checking the value of the same variable.The case command takes a list format to examine multiple values for a single variable.Syntax: Note the two semicolons that followCase variable inPattern1 | PATTERN2)

The 25th chapter of the Linux command line and shell scripting Encyclopedia creates scripts related to databases, web, and e-mail

2017 09:48:22 +0800from localhost [127.0.0.1]-----The following addresses had permanent fatal errors-----[email protected]>(reason:550 Failed to connect remote host.)-----Transcript of Session follows-----... while talking to mx3.qq.com.:... while talking to mx2.qq.com.:So the machine was restarted a bit. You can do it.[Email protected]:/var/mail$ Echo]20171204tete" | Mail-s "TEst2"Xcy[Email protected]:/var/mail$ Mail"/var/mail/xcy": 3 messages 1 new 2 unreadU 1 Mail Delivery Subs December 4 10

"Linux command line and Shell Scripting Encyclopedia" chapter 26th some interesting scripts

-be-sustained by perpetual neglect of many and other things. Robert Louis Stevenson (1850-1894) [Email protected]:~/shell/26zhang$ Note this:#grep "$ (date +%b '%-d, '%Y)"-A2 |Since my Ubuntu is in Chinese, I have not been searching for November. I'm going to replace it with this one, only 28, 2017.grep ", $ (date +%y)"-a2 | # Xcy AddIt would have been like this grep "$ (date +%-d, '%Y)"-A2 | # xcy Add, don't know why my date is 29. And the site is

"Linux command line and Shell Scripting Encyclopedia" chapter Fourth

fileYou can also connect many parameters.such as Sort-t ': '-K 3 testYou can think of it as something inside. xxx1:xxx2:xxx3:xxx4:xxx5means to sort the xxx3-T: Specifies a character to distinguish the key position-K:--key=pos1[pos1]. The sort starts with pos1, and if POS2 is specified, it ends at Pos2.| Redirects the output of the du command to the sort command.-r: Indicates descending order.Here is an example:4.3.21. grep [options] pattern [file]For example:grep t test//Search for text in test

The tenth chapter of the Linux command line and Shell scripting Encyclopedia uses the editor

Previous Edit CommandA: Append data after the current cursorO: The next line of the cursor inserts dataDW Delete a Wordd$ Delete to end of lineDD: Delete Row, 5dd delete 5 rowsThe use of backspace and delete keys in normal mode is not recognized.10.1.4 Copy and pasteDD can be pasted with p after deletion.The copy command is Y,YW copy a wordy$ Copy to end of lineThen use p to paste10.1.5 Find Replacement: s/old/new/g a

Use the comm command line tool in Linux

Linux comm command line tool-general Linux technology-Linux technology and application information, the following is a detailed description. If you want to compare the content of the two text files in Linux Command

An introductory tutorial on Linux shell scripting _linux Shell

From a programmer's point of view, the shell itself is a program written in C language, from the user's point of view, the shell is the user and the Linux operating system communication Bridge. Users can either enter command execution and use shell scripting to accomplish mo

Shell scripting Tips (1)-How to resolve a multiline redirect Terminator in a script without snapping to the beginning of the line

Tags: shell multi-line redirection1. What is the problem requirement?First, the need to come from, mainly to write shell script, with cat for multi-line input redirection, the Terminator must be hyphenation first, the format is not good-looking.2, how? How to solve this problem?First Baidu, Google search the next, the

Introduction to shell scripting for Linux, shell script structure and execution, date command usage, variables in shell scripts

:07Variables in shell scripts You should use a variable instead when you use a string more frequently in your script and the string length is long When using conditional statements, variables are often used?? If [$a-gt 1]; Then ...; Fi When referencing the result of a command, replace it with a variable?? n=wc -l 1.txt When writing scripts for user interaction, variables are also necessary?? Read-p "Input a number:" N; echo $n?? I

Shell Scripting Learning Notes: Implementing Linux User management and monitoring through the shell

$name >/dev/nullif [$?-eq0];thenstr= "user${name}isdeletesuccessfully!!!" echo-e "\033[30;47m$str\033[0m" elsestr= "user${name}isdeletefailly!!!" echo-e "\033[31;47m$str\033[0m" fi ;; 5) str= ' df-th ' echo-e "\033[30;47m$str\033[0m";; 6) str= ' free -m ' echo-e "\033[30;47m$str\033[0m" ;; 7) clearmenu;; 8) echo-e "\e[31mlogout...\e[0m" sleep1break;; NBSP;NBSP;NBSP;NBSP;NBSP;NBSP;NBSP;NBSP;NBSP;NBSP;NBSP;NBSP;NBSP;NBSP;NBSP;NBSP;9) echo-e "\e[31mquitsuccessfully!!! \e[0m " exit;; *) str= "I

Shell scripting exercises for the Linux shell scripts

-50.png "alt=" Wkiol1mdkm2jz6uoaabbjl5wdhm575.png "/>650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M00/00/D0/wKiom1mdk6ihkQAmAAAUhdjoX-o745.png "style=" float : none; "title=" screenshot from 2017-08-23 22-38-48.png "alt=" Wkiom1mdk6ihkqamaaauhdjox-o745.png "/>650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M02/9F/80/wKioL1mdk56TXfZHAAATseIwAOw478.png "style=" float : none; "title=" screenshot from 2017-08-23 22-39-10.png "alt=" Wkiol1mdk56txfzhaaatseiwaow478.png "/>15. Queryin

Total Pages: 6 1 2 3 4 5 6 Go to: Go

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.